<style>
    .container-projectPlan .actions .fa {
        margin: 0px 5px;
        font-size: 14px;
        cursor: pointer;
    }

    .container-projectPlan .actions .danger {
        color: gold;
    }

    .container-projectPlan .fa-external-link {
        margin-top: 5px;
    }
</style>

<m-project-plan project-plan-name="{{info.projectPlanInfo.projectPlanName}}" select-tab="project">
    <div class="panel panel-default">
        <div class="panel-heading">
            <div class="btn btn-primary btn-xs" ng-click="openCreateProjectModal()"><i class="fa fa-plus"></i> 添加工程
            </div>
        </div>
        <div class="panel-body">
            <table class="table table-bordered table-striped table-hover">
                <thead>
                <tr>
                    <th style="width: 3%;">序号</th>
                    <th style="width: 10%;">工程</th>
                    <th style="width: 15%;">分支</th>
                    <th style="width: 6%;">构建状态</th>
                    <th style="width: 15%;">代码版本库</th>
                    <th style="width: 5%;">分支版本号</th>
                    <th style="width: 6%;">状态</th>
                    <th style="width: 8%;">提测版本</th>
                    <th style="width: 8%;">测试中版本</th>
                    <th style="width: 8%;">申请集成版本</th>
                    <th style="width: 8%;">当前集成版本</th>
                    <th style="width: 8%;">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="project in info.projectArray | limitTo: 10">
                    <td>{{$index + 1}}</td>
                    <td>
                        {{ project.project_status == "PRO_MERGED" ? project.trunk_name + "(原工程分支)" : (project.plan_id !=
                        info.projectPlanInfo.uplanId ? project.trunk_name + "(集成计划分支)" : project.trunk_name) }}
                    </td>
                    <td>
                        <span ng-if="project.isOnBeetle == '0'">
                            <a href="javascript:void(0)" class="btn-link"
                               data-tooltip-html-unsafe="{{project.branchTip}}">
                                {{project.project_name | limitTo : 30}}...
                            </a>
                            <i class="fa fa-external-link pull-right"
                               popover="点击跳转工程构建页面"
                               popover-trigger="mouseenter"
                               ng-click="toUrlClick(project)">
                            </i>
                        </span>
                    </td>
                    <td>{{ project.isOnBeetle == "0" ? project.build_status : "" }}</td>
                    <td>
                        <span ng-if="project.isOnBeetle == '0'">
                            <span ng-if="project.vcs_path.length <= 20">{projecti.vcs_path}}</span>
                            <a ng-if="project.vcs_path.length > 20"
                                href="javascript:void(0)"
                                class="btn-link" type="button"
                                popover="{{project.vcs_path}}" popover-trigger="mouseenter">
                            {{project.vcs_path | limitTo : 40}}...
                            </a>
                        </span>
                    </td>
                    <td>{{ project.branch_num }}</td>
                    <td>{{ project.project_status }}</td>
                    <td>{{ project.to_test_edition }}</td>
                    <td>{{ project.testing_edition }}</td>
                    <td>{{ project.to_integration_edition }}</td>
                    <td>{{ project.integrationing_edition }}</td>
                    <td class="actions">
                        <div ng-if="info.actionStatus">
                            <i class="fa fa-hand-o-right" popover="修改工程当前提测版本" popover-trigger="mouseenter"
                               ng-show="project.editCurrentBtn" ng-click="openEditionModel('TEST', project)"></i>
                            <i class="fa fa-hand-o-right danger" popover="修改工程申请集成版本" popover-trigger="mouseenter"
                               ng-show="project.editApplyBtn" ng-click="openEditionModel('INTEGRATION', project)"></i>
                            <i class="fa fa-code-fork" popover="切换分支" popover-trigger="mouseenter"
                               ng-show="project.checkoutBranch" ng-click="openSwitchBranchModal(project)"></i>
                            <i class="fa fa-trash" popover="删除工程" popover-trigger="mouseenter"
                               ng-click="deleteProject(project)"></i>
                        </div>
                    </td>
                </tr>
                </tbody>
            </table>
            <pagination boundary-links="true"
                        total-items="totalItems"
                        ng-model="info.pageIndex"
                        class="pagination-sm m-t-none m-b pull-right"
                        previous-text="上一页"
                        next-text="下一页"
                        first-text="首页"
                        last-text="尾页"
                        ng-click="setList()"
                        ng-if="info.showPagination">
            </pagination>
        </div>
    </div>
</m-project-plan>